home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / lu62 / port / actdlc.h < prev    next >
C/C++ Source or Header  |  1996-07-10  |  7KB  |  196 lines

  1. /* k 0001     05/07/90    */
  2. /* k 0009    05/07/90        */
  3. /* k 0024     16/07/90    */
  4. /* k 1005       14/09/90        */
  5. /* k 1007       24/09/90        */
  6. /* k 1008       27/09/90        */
  7. /* k 1015       13/11/90        */
  8. /* k 0087    03/12/90    */
  9. /* k 0207    06/09/91    *//* delete naus */
  10. /* k 0221    17/09/91    *//* pmsgop instead cmsgop */
  11. /* k 0224       23/09/91        *//* ebss */
  12. /* k 0238    19/10/91    *//* act/deact */
  13. /* k 0307       24/02/92        */
  14. /* k 1079   04/03/92    */ /* ptr to dlctb in rqb for dlc-prog */
  15. #include <ebss.h>               /* @0224 */
  16. #include <stdio.h>          /* actdlc.c */
  17.   /* @0207 */
  18. #if (RESIDENT==1)    /* @0238 */
  19.   extern struct segprf *preqseg();    /* @0087 */
  20.   extern struct rqb *preqrq();                    /* 0009 */
  21. #else
  22.   extern struct segprf *Res_preqseg();    /* @0087 */
  23.   extern struct rqb *Res_preqrq();                    /* 0009 */
  24. #endif
  25.   /* @0221 */
  26.   short actdlc(struct dlctb *wd)
  27.   {
  28.      struct rqb *rp;
  29.      struct segprf *wseg;       /* 1015 */
  30.      short wcnt,i;                        /* @0024 */
  31.  /*    char rtnlan[5]= LAN ;     name routine LAN */
  32.  /*    char namefl[9]='A0000001';  name file for load LAN */
  33.                                 /* 0009 */
  34.      char *w,*w1;              /* work pointer  */
  35.      if (wd->type==DLCLAN)      /* if LAN        */
  36.         goto LAN1;              /* @0307 */
  37.      if (wd->type==DLC7920)     /* if 7920        */
  38.          goto A7920;
  39.      if (wd->type==DLCTRN)      /* if TRN        */             /* 1007 */
  40.          goto TRN;                                              /* 1007 */
  41.      if (wd->type==DLCTRN39)    /* if 8439        */             /* 1007 */
  42.          goto TRN39;                                              /* 1007 */
  43.      if (wd->type==DLCASY)      /* if async       */             /* 1051 */
  44.          goto ASYNC;                                             /* 1051 */
  45.        { pmsgop(18);        /* @0221 */
  46.      return -1;  }   /* unsupported dlc type */    /* 0009 */
  47.  LAN1:               /* @0307 */
  48.   /*      initiate     DLCCB   */
  49.       wd->count=wd->count+1; /* count of use     */
  50.   /*    building RQB  for LAN-LOAD process             */
  51.      if ((rp=
  52. #if (RESIDENT==0)
  53.    Res_preqrq
  54. #else
  55.      preqrq
  56. #endif
  57.      (1))==0)    {                /* 0009 */
  58.        pmsgop(22); /* No rqb to activate DLC */    /* 0009 *//* @0221 */
  59.        return 0;                        /* 1008 */
  60.                 }                /* 0009 */
  61.      rp->th.ra.code &= 0xfc;    /* @0157 */
  62.      rp->th.ra.code |=ATTACH;    /* @0157 */
  63.      rp->th.ra.stcb=LAN_CODE;
  64.      rp->th.ra.rparm.parm.parm1=ACTIVATE;
  65.      rp->th.ra.rparm.parm.parm2=wd->dlccbi;   /* index lan-station */
  66.      rp->link=0;
  67.      w=rp->th.ra.wa.area;                         /* 0009 */
  68.      w1=wd->name;                        /* 0009 */
  69.      for (i=0;i<8;i++)                                          /* @0024 */
  70.        w[i]=w1[i];       /* name loading file   */        /* @0024 */
  71. #if (RESIDENT==0)
  72.      Res_pattach(rp);
  73. #else
  74.      pattach(rp);
  75. #endif
  76.      return 0;                                     /* 1008 */
  77. /* * * * * * * * * * * * * * * * * * * * * * * */  /* 1005 */
  78.  A7920:
  79.   /*      initiate     DLCCB for 7920         */
  80.       wd->count=wd->count+1; /* count of use     */
  81.   /*    building RQB  for dlc7920 activate-process  */
  82.      if ((wseg=
  83. #if (RESIDENT==1)
  84.      preqseg
  85. #else
  86.    Res_preqseg
  87. #endif
  88.      (16))==0)                  /* 1015 */ /* @0087 */
  89.     { pmsgop(22);     /* No rqb to activate DLC *//* @0221 */
  90.        return 0;  }                            /* 1008 */
  91.      rp=(struct rqb *)((char *)wseg+12);     /* 1015 */    /* @0087 */
  92.      rp->th.ra.code &= 0xfc;    /* @0157 */
  93.      rp->th.ra.code |=ATTACH;    /* @0157 */
  94.      rp->th.ra.stcb=DLC7920_CODE;
  95.      rp->th.ra.rparm.parm.parm1=ACTIVATE;
  96.      rp->th.ra.rparm.parm.parm2=wd->dlccbi;   /* index 7920-station */
  97.      wd->flg1 = ACTIV;                        /* flag activate      */
  98.      wseg->un.nau=wd;                 /* ptr to dlctb  1015         */
  99.      rp->link=0;
  100. #if (RESIDENT==0)
  101.      Res_pattach(rp);
  102. #else
  103.      pattach(rp);
  104. #endif
  105.      return 0;                                       /* 1008 */
  106. /* * * * * * * * * * * * * * * * * * * * * * * * */  /* 1007 */
  107.  TRN:
  108.   /*      initiate     DLCCB for TRN         */
  109.       wd->count=wd->count+1; /* count of use     */
  110.   /*    building RQB  for DLCTRN activate-process  */
  111.      if ((wseg=
  112. #if (RESIDENT==1)
  113.      preqseg
  114. #else
  115.    Res_preqseg
  116. #endif
  117.      (16))==0)                  /* 1015 */ /* @0087 */
  118.     { pmsgop(22);     /* No rqb to activate DLC *//* @0221 */
  119.        return 0;  }                            /* 1008 */
  120.      rp=(struct rqb *)((char *)wseg+12);     /* 1015 */    /* @0087 */
  121.      rp->th.ra.code &= 0xfc;    /* @0157 */
  122.      rp->th.ra.code |=ATTACH;    /* @0157 */
  123.      rp->th.ra.stcb=DLCTRN_CODE;
  124.      rp->th.ra.rparm.parm.parm1=ACTIVATE;
  125.      rp->th.ra.rparm.parm.parm2=wd->dlccbi;   /* index TRN          */
  126.      wd->flg1 = ACTIV;                        /* flag activate      */
  127. /*     rp->th.ra.wa.hh.hscb=wd;      */           /* 1079           */
  128.      wseg->un.nau=wd;                 /* ptr to dlctb  1079         */
  129.      rp->link=0;
  130. #if (RESIDENT==0)
  131.      Res_pattach(rp);
  132. #else
  133.      pattach(rp);
  134. #endif
  135.      return 0;                                        /* 1008 */
  136.  /* * * * * * * * * * * * * * * * * * * * * * * * */  /* 1007 */
  137.  TRN39:
  138.   /*      initiate     DLCCB for 8439         */
  139.       wd->count=wd->count+1; /* count of use     */
  140.   /*    building RQB  for DLCTRN activate-process  */
  141.      if ((wseg=
  142. #if (RESIDENT==1)
  143.      preqseg
  144. #else
  145.    Res_preqseg
  146. #endif
  147.      (16))==0)                  /* 1015 */ /* @0087 */
  148.     { pmsgop(22);     /* No rqb to activate DLC *//* @0221 */
  149.        return 0;  }                            /* 1008 */
  150.      rp=(struct rqb *)((char *)wseg+12);     /* 1015 */    /* @0087 */
  151.      rp->th.ra.code &= 0xfc;        /* @0157 */
  152.      rp->th.ra.code |=ATTACH;        /* @0157 */
  153.      rp->th.ra.stcb=DLCTRN39_CODE;
  154.      rp->th.ra.rparm.parm.parm1=ACTIVATE;
  155.      rp->th.ra.rparm.parm.parm2=wd->dlccbi;   /* index TRN          */
  156.      wd->flg1 = ACTIV;                        /* flag activate      */
  157. /*     rp->th.ra.wa.hh.hscb=wd;      */           /* 1079           */
  158.      wseg->un.nau=wd;                 /* ptr to dlctb  1079         */
  159.      rp->link=0;
  160. #if (RESIDENT==0)
  161.      Res_pattach(rp);
  162. #else
  163.      pattach(rp);
  164. #endif
  165.      return 0;                                    /* 1008 */
  166. /* * * * * * * * * * * * * * * * * * * * * * * */  /* 1051 */
  167.  ASYNC:
  168.   /*      initiate     DLCCB for async port         */
  169.       wd->count=wd->count+1; /* count of use     */
  170.   /*    building RQB  for async-routine activate-process  */
  171.      if ((wseg=
  172. #if (RESIDENT==1)
  173.      preqseg
  174. #else
  175.    Res_preqseg
  176. #endif
  177.      (16))==0)
  178.     { pmsgop(22);     /* No rqb to activate DLC *//* @0221 */
  179.        return 0;  }
  180.      rp=(struct rqb *)((char *)wseg+12);
  181.      rp->th.ra.code &= 0xfc;
  182.      rp->th.ra.code |=ATTACH;
  183.      rp->th.ra.stcb=DLCASY_CODE;
  184.      rp->th.ra.rparm.parm.parm1=ACTIVATE;
  185.      rp->th.ra.rparm.parm.parm2=wd->dlccbi;   /* index async-port   */
  186.      wd->flg1 = ACTIV;                        /* flag activate      */
  187.      wseg->un.nau=wd;                         /* ptr to dlctb       */
  188.      rp->link=0;
  189. #if (RESIDENT==0)
  190.      Res_pattach(rp);
  191. #else
  192.      pattach(rp);
  193. #endif
  194.      return 0;
  195.  }
  196.